/**
 * 判断对象属性是否存在，值是否为空字符串
 * @param {object} object
 * @param {array} columnNames
 * @return {boolean}
 */
function filterKey(object, columnNames) {
  for (const key in object) {
    if (Object.hasOwnProperty.call(object, key)) {
      if (columnNames.some(item => item === key)) {
        if (object[key] === '') {
          return false
        }
      } else {
        return false
      }
    }
  }

  return true
}

module.exports = {
  filterKey
}
